//
//  StrategyDetailTableViewController.m
//  BJS151148_ TeamProject_Travel
//
//  Created by lanou3g on 16/3/23.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "StrategyDetailTableViewController.h"
#import "StrategyDetailTableViewCell.h"
@interface StrategyDetailTableViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,strong)NSMutableArray * allDataArray;
@end

@implementation StrategyDetailTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.allDataArray = [NSMutableArray array];
    
    [self.tableView registerNib:[UINib nibWithNibName:@"StrategyDetailTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"strategyDetail"];
//    [self.tableView registerClass:[StrategyDetailTableViewCell class] forCellReuseIdentifier:@"strategyDetail"];
    
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    
}


#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    StrategyDetailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"strategyDetail" forIndexPath:indexPath];
    if (cell == nil) {
        cell = [[StrategyDetailTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"strategyDetail"];
    }
    
    cell.backImageView.image = [UIImage imageNamed:@"image001.jpg"];
    cell.titleLabel.text = @"大不列颠,英吉利海峡";
    [cell.strategyButton addTarget:self action:@selector(pushToStrategy) forControlEvents:UIControlEventTouchUpInside];
    [cell.routeButton addTarget:self action:@selector(pushToRoute) forControlEvents:UIControlEventTouchUpInside];
    [cell.destinationButton addTarget:self action:@selector(pushToDestinatioin) forControlEvents:UIControlEventTouchUpInside];
    [cell.specialButton addTarget:self action:@selector(pushToSpecial) forControlEvents:UIControlEventTouchUpInside];
    cell.downloadButton.layer.cornerRadius = 8;
    cell.downloadButton.layer.masksToBounds = YES;
    [cell.downloadButton addTarget:self action:@selector(downloadAction) forControlEvents:UIControlEventTouchUpInside];
    
    return cell;
}

- (void)downloadAction{
    
}

- (void)pushToStrategy{
    
}

- (void)pushToRoute{
    
}

- (void)pushToDestinatioin{
    
}

- (void)pushToSpecial{
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return [UIScreen mainScreen].bounds.size.height / 2;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
